import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
// import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

import 'package:webview_flutter/webview_flutter.dart';

class HomeView extends StatefulWidget {
  @override
  State<HomeView> createState() => _HomeViewState();
}

class _HomeViewState extends State<HomeView> {
  @override
  void initState() {
    super.initState();
    SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
    // if (Platform.isAndroid) WebView.platform = AndroidWebView();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // url: "https://cobra.jasoncui.online/workshopData",
      // withJavascript: true,
      body: WebView(
        // https://cobra.jasoncui.online/workshopData
        // https://pivm.jasoncui.online/index
        initialUrl: "https://pivm.jasoncui.online/workshop/3",
        javascriptMode: JavascriptMode.unrestricted,
        // gestureNavigationEnabled: true,
        // allowsInlineMediaPlayback: true,
        // onWebViewCreated: (WebViewController webViewController) {},
        // onProgress: (int progress) {},
        // onPageFinished: (url) {},
      ),
      // body: InAppWebView(
      //   initialUrlRequest: URLRequest(
      //     url: Uri.parse("https://cobra.jasoncui.online/workshopData"),
      //   ),
      // ),
    );
  }
}
